<link href="/activity/christmas/sd.css" media="screen" rel="stylesheet" type="text/css" >
<script type="text/javascript"> 
    var SysSecond = <?php echo $this->startTimes; ?>; 
    var InterValObj;

     $(document).ready(function() {
         InterValObj = window.setInterval(SetRemainTime, 1000); //间隔函数，1秒执行 
     });

     function SetRemainTime() {
         if (SysSecond > 0) {
             SysSecond = SysSecond - 1;
             var second = Math.floor(SysSecond % 60);             // 计算秒     
             var minite = Math.floor((SysSecond / 60) % 60);      //计算分 
             var hour = Math.floor((SysSecond / 3600) % 24);      //计算小时 
             var day = Math.floor((SysSecond / 3600) / 24);        //计算天 
             var tend = Math.floor(day / 10);
             var d = day % 10;
             $(".times_tend").html(tend);
             $(".times_d").html(d);
             $(".times_h").html(hour>=10?hour:"0"+hour);
             $(".times_s").html(minite>=10?minite:"0"+minite);
             $(".times_i").html(second>=10?second:"0"+second);
             $("#remainTime").html(day + "天" + hour + "小时" + minite + "分" + second + "秒");
         } else {
             window.clearInterval(InterValObj);
         }
     }
</script> 
<div class="shengdan_one">
	<div class="shengdan_djs">
    	<div class="shengdannum">
            <ul>
                <li class="times_tend">0</li><li class="times_d">0</li>
            </ul>
        </div>
        <p><span class="times_h">00</span>时<span class="times_s">00</span>分<span class="times_i">00</span>秒</p>
    </div>
</div>
<div class="shengdan_two"></div>
<div class="shengdan_three"></div>
<div class="shengdan_four">
	<div class="shengdan_djs">
    	<a class="shengdanqiang" href="/purchase/index" target="_black">现在就抢</a>
    </div>
</div>
<div class="shengdan_five"></div>
<div class="shengdan_six">
	<div class="shengdan_djs">
    	<div class="shengdanyhj">
        	<!--去掉 class="yjok"为没有领取-->
        	<ul>
            	<li <?php echo $this->receiveType["10"]?'class="yjok"':'';?>>
                    <div class="yhq"><a class="yh1" href="javascript:void(0)"></a></div>
                    <div class="yhqlq">
                    	<a class="lq1" href="javascript:void(0)" name="10"><?php echo $this->receiveType["10"]?'已领取':'立即领取';?></a>
                    </div>
                </li>
            	<li <?php echo $this->receiveType["20"]?'class="yjok"':'';?>>
                    <div class="yhq"><a class="yh2" href="javascript:void(0)"></a></div>
                    <div class="yhqlq">
                    	<a class="lq2" href="javascript:void(0)" name="20"><?php echo $this->receiveType["20"]?'已领取':'立即领取';?></a>
                    </div>
                </li>
            	<li <?php echo $this->receiveType["50"]?'class="yjok"':'';?>>
                    <div class="yhq"><a class="yh3" href="javascript:void(0)"></a></div>
                    <div class="yhqlq">
                    	<a class="lq3" href="javascript:void(0)" name="50"><?php echo $this->receiveType["50"]?'已领取':'立即领取';?></a>
                    </div>
                </li>
            	<li <?php echo $this->receiveType["100"]?'class="yjok"':'';?>>
                    <div class="yhq"><a class="yh4" href="javascript:void(0)"></a></div>
                    <div class="yhqlq">
                    	<a class="lq4" href="javascript:void(0)" name="100"><?php echo $this->receiveType["100"]?'已领取':'立即领取';?></a>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</div>
<div class="tanchuang" style="height: 200px;display: none;">
    <div class="nui-msgbox">
        <div class="nui-msgbox-hd" style="font-size: 16px;">系统消息</div>
        <a class="nui-msgbox-close" title="关闭"><b></b></a>
    </div>
    <div class="wenti_box">
        <div style="margin-left: 20px;font-size: 16px;margin-top: 20px;width: 560px;">
            <h3>尊敬的会员：</h3>
            <p style="padding-left: 30px;" class="remessage"></p>
            <p style="margin-top: 20px;margin-left: 150px;"><a href="javascript:void(0)" class="exitproblem" ><span class="countdown">10</span>秒后自动关闭，立即关闭。</a></p>
        </div>
    </div>
</div>
<div class="houtai_overlay" style="display: none;"></div>
<div class="shengdan_seven">
	<div class="shengdansm">
    	<h2>代金券说明</h2>
        <p>代金券可以用于抵扣国际快递运费，有效期为1个月，从领取之日开始计算。所有悠奇会员均可免费领取代金券。代金券领取之后可在悠奇"我的账户—我的优惠券"里查看。</p>
    </div>
    
    
    <div class="lianjie">
    	<ul>
        	<li><a href="http://www.taobao.com/go/market/2013/1212/main.php" title="淘宝2012" target="_blank"><img src="/activity/christmas/images/tb1.png" /></a></li>
        	<li><a href="http://www.taobao.com/go/market/2013/1212/nvren.php?spm=a215f.6944601.a2148k7.d03.EyUizq" title="淘宝女人场" target="_blank"><img src="/activity/christmas/images/tb2.png" /></a></li>
        	<li><a href="http://www.taobao.com/go/market/2013/1212/nanren.php?spm=a215f.6944601.a2148k7.d02.EyUizq" title="淘宝男人场" target="_blank"><img src="/activity/christmas/images/tb3.png" /></a></li>
        	<li><a href="http://www.taobao.com/go/market/2013/1212/mei.php?spm=a215f.6944601.a2148k7.d05.EyUizq" title="淘宝美妆" target="_blank"><img src="/activity/christmas/images/tb4.png" /></a></li>
        	<li><a href="http://www.taobao.com/go/market/2013/1212/home.php?spm=a215f.6944601.a2148k7.d04.EyUizq" title="淘宝2012家居生活馆" target="_blank"><img src="/activity/christmas/images/tb5.png" /></a></li>
        	<li><a href="http://www.taobao.com/go/market/2013/1212/jiehun.php?spm=a215f.6944601.a2148k7.d11.EyUizq" title="淘宝婚庆" ><img src="/activity/christmas/images/tb6.png" /></a></li>
        </ul>
    </div>
</div>
<script>
    var leftSeconds = 10;
    setInterval("CountDown()", 1000);
    $(".yhqlq a").click(function(){
       var no = $(this).attr("name");
       $.ajax({
            type: 'POST',
            url: '/campaign/receive/activity/christmas/batch/FullDiscount/no/' + no,
            success: function(data) {
                if(data.type == 1){
                    $("a[name='"+no+"']").text("已领取");
                    $("a[name='"+no+"']").closest("li").addClass("yjok");
                } else if(data.type == 2){
                    window.location = '/user/login?returnUrl=<?php echo $this->reUrl;?>';
                    return ;
                }
                $(".tanchuang").show();
                $(".houtai_overlay").show();
                $(".remessage").html(data.message);
                
            }
        });
    });
    $(".nui-msgbox-close").click(function(){
        $("div.houtai_overlay").hide();
        $("div.tanchuang").hide();
        leftSeconds = 10;
    });
    $(".exitproblem").click(function(){
        $("div.houtai_overlay").hide();
        $("div.tanchuang").hide();
        leftSeconds = 10;
    }); 
    function CountDown() {
        if(leftSeconds==0){
            $(".exitproblem").click();
            leftSeconds = 10;
        }
        leftSeconds--;
        $(".countdown").html(leftSeconds);
    }
</script>
